//
//  ViewController.m
//  Tire
//
//  Created by 王奎卿 on 2017/3/21.
//  Copyright © 2017年 wkq. All rights reserved.
//

#import "ViewController.h"
#import "MainViewController.h"
#import "LianSuoViewController.h"
#import "XuanTaiViewController.h"
#import "FindViewController.h"
#import "MyViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    [self tabBarControl];
}

- (void)tabBarControl
{
    MainViewController *mainView = [[MainViewController alloc]init];
    LianSuoViewController *lianView = [[LianSuoViewController alloc]init];
    XuanTaiViewController *xuanView = [[XuanTaiViewController alloc]init];
    FindViewController *findView = [[FindViewController alloc]init];
    MyViewController *myView = [[MyViewController alloc]init];
    
    UINavigationController *mainNav = [[UINavigationController alloc]initWithRootViewController:mainView];
    UINavigationController *lianNav = [[UINavigationController alloc]initWithRootViewController:lianView];
    UINavigationController *xuanNav = [[UINavigationController alloc]initWithRootViewController:xuanView];
    UINavigationController *findNav = [[UINavigationController alloc]initWithRootViewController:findView];
    UINavigationController *myNav = [[UINavigationController alloc]initWithRootViewController:myView];
    
    mainNav.tabBarItem.title = @"首页";
    lianNav.tabBarItem.title = @"连锁店";
    xuanNav.tabBarItem.title = @"选胎";
    findNav.tabBarItem.title = @"发现";
    myNav.tabBarItem.title = @"我的";
    
    mainNav.tabBarItem.image = [UIImage imageNamed:@"首页.png"];
    lianNav.tabBarItem.image = [UIImage imageNamed:@"选胎.png"];
    xuanNav.tabBarItem.image = [UIImage imageNamed:@"选胎.png"];
    findNav.tabBarItem.image = [UIImage imageNamed:@"发现.png"];
    myNav.tabBarItem.image = [UIImage imageNamed:@"我的.png"];
    
    self.viewControllers = @[mainNav,lianNav,xuanNav,findNav,myNav];
    self.tabBar.tintColor = [UIColor colorWithRed:239/255.0 green:138/255.0 blue:58/255.0 alpha:1];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
